<template>
  <div id="app">
    <div class="switch">
      <button @click="switchLang('zh-cn')">中文(简体)</button>
      <button @click="switchLang('zh-tw')">中文(繁体)</button>
      <button @click="switchLang('en')">English</button>
    </div>
    <div class="content">
      <span>{{ $t('message') }}</span>
    </div>
  </div>
</template>

<script>
export default {
  name: 'App',
  methods: {
    switchLang(lang) {
      this.$i18n.locale = lang;
    },
  },
};
</script>

<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
  .switch {
    display: flex;
    justify-content: center;
    align-items: center;
    button {
      font-size: 24px;
      height: 40px;
      margin: 0 10px;
    }
  }
  .content {
    margin-top: 40px;
    span {
      font-size: 40px;
    }
  }
}
</style>
